home *** CD-ROM | disk | FTP | other *** search
/ CD Exchange / CD Exchange - Volume 1.iso / d.t.p / utils / propage / donsgenies / donsgenies.lha / Don'sGenies / ILBMsUsingPost.pprx < prev    next >
Text File  |  1993-05-25  |  3KB  |  71 lines

  1. /* This genie uses the public domain Postscript interpreter "Post" to save your work as a set of numbered ILBM files in HiRes, 8 colours. You will be asked for the name of the first file (the numbers are added automatically). The files "post" and "init.ps" should be in a drawer called "post" in your "PPage:" drawer (if not, modify the indicated line in the genie), the necessary .psfont files in CGFonts:ps, and "post.library" in libs:  You do NOT need "Conman". 
  2. Make sure the assigns for PPage: and CGFonts: are set up in your startup-sequence or user-startup files. The page size should be set to 6.4 by 5.12 inches for 640x512 (PAL), 6.4 by 4.0 for 640x400 (NTSC): the size in inches is 1/100 the size in pixels.  */
  3. /* Note: There is a bug in Post which means that it may refuse to print colour bitmaps on colour printers under WB 2.04. It seems to be OK under WB 1.3, and again with WB3.0 and PPage 4.0.  
  4. Versions of Post older than 1.7 have problems with eps files from Quark XPress and Freehand.
  5. */
  6. /* Written by and copyright Don Cox, 1992. All rights reserved. Not Public Domain.  */
  7. trace n
  8.  
  9. signal on error
  10. signal on syntax
  11. address command
  12. call SafeEndEdit.rexx()
  13. call ppm_AutoUpdate(0)
  14. oldunits = ppm_GetUnits()
  15. call ppm_SetUnits(1)
  16. cr="0a"x
  17.  
  18. prompt = "Type file name for pictures..."
  19. basename = ppm_GetFileName(prompt, "PPage:")
  20.  
  21. pagesize = ppm_GetPageSize()
  22. pagewidth = word(pagesize,1)
  23. pageheight = word(pagesize,2)
  24. pixelwidth = trunc(pagewidth*100)
  25. pixelheight = trunc(pageheight*100)
  26. call ppm_SetPSPageSize(pagewidth,pageheight)
  27. oldoutput = ppm_GetPSOutput()
  28. oldmode = ppm_GetPSPrintMode()
  29. call ppm_SetPSFontDownload(0)
  30. call ppm_SetPSOutput("ram:temp.ps")
  31. call ppm_SetPSPrintMode(2)
  32. success = ppm_PrintDocPS(1,1)
  33. if success ~=1 then exit_msg("Failed saving temporary Postscript file.")
  34.  
  35.  
  36. /* Set up a text file in ram: and then send it to a temporary command window */
  37. conwindow = "CON:40/40/500/200/NewWindow"
  38. call open out, "ram:temp", write  /* This wipes out any existing ram:temp  */
  39. call writeln out, "cd PPage:Post" /* post is in drawer "Post" in "PPage:" - if not, change this line  */
  40.  
  41. call writeln out, "post init.ps ram:temp.ps iff "basename"??? size x"pixelwidth"y"pixelheight"xd100yd100c3"
  42. call writeln out, "delete ram:temp.ps"
  43. call writeln out, "endcli"
  44. call close out
  45. "newcli" conwindow "ram:temp"
  46.  
  47. call ppm_SetPSOutput(oldoutput)
  48. call ppm_SetPSPrintMode(oldmode)
  49. call exit_msg()
  50.  
  51. end
  52.  
  53. error:
  54. syntax:
  55.     do
  56.     exit_msg("Genie failed due to error: "errortext(rc))
  57.     end
  58.  
  59. exit_msg:
  60.     do
  61.     parse arg message
  62.     if message ~= "" then
  63.     call ppm_Inform(1,message)
  64.     call ppm_SetUnits(oldunits)
  65.     call ppm_ClearStatus()
  66.     call ppm_PPageToFront()
  67.     call ppm_AutoUpdate(1)
  68.     exit
  69.     end
  70.  
  71.